Fix ordering of declared fields

fix #40 (see comment by @zerodivisi0n)