Fixed bugs here and there