Fixed minor bugs and removed pointless test