Fix minimal bugs