Fixes stupid syntax and logic errors.