Fix offset (other stuff still broken though)

(note - once everything is debugged i'm going to squash the commits, hence the low-quality commit messages)