Fixing couple of simple bugs