Fixing input bugs