Fix several small issues