htmlentities isn't recursive. If you apply it using an array_map to an array such as $_GET or $_POST, than when it hits a value that isn't scalar such as these booktype checkboxes, it simply chokes and issues a warning. It then returns null since it doesn't know what else to do with it.
The implode is deficient only because of the htmlspecialchars. You should still use proper isset checking to make sure its there first, but on the plus side at least you have the check for a posted form.
So to fix this, simply write a method for htmlentities that's recursive. It's job is only to see if the input is an array, and if so, recurse each item in the array and save the results back. Return the results at the end. Map that to the array_map, and that should work.
header('HTTP/1.1 420 Enhance Your Calm');