Fixed input bugs