Fix several small issues

mostly trivial changes from cloud9
@lennartcl