Fixed some issues with input