Bug fixes, sorry I do not have accompanying tests