Improved inputvalidation, error handling and localization