Fixed minor bugs