Fixed simple bugs