Fixed several small issues