Fixed some minor bugs created by most recent commits