Fixes pointed out by @zrax.