Fixed minor bugs introduced by the clean up