Fixes and guards against strange values