Modified files to work with new engine. Also it segfaults now.