Fixed numerous small problems