Removed a call to 'reverse', and fixed some other errors that the fix exposed

Should resolve problem @himedlooff was having