Fixed the divide bug in grammar