Fix some parsing and pretty printing issues