Bug fixes

Various fixes to trace back errors
yea that does seem wrong, ill fix