This is embarassing.. The reason it crashed was because I forgot to put LoadDll in exports clause.
Thanks for the hint.