Improvements to input reading for some problems