Fix references
Get rid of extended ASCII
Update macro to modern latex
Fix stuff from Niclas