BUGFIX: moving typedef after RECORD definition