Small Changes and Fixes

Check for empty input etc.