Fixed input overflow and broken operations.