Some fixes for $input