BUGFIX: Functions definition order was wrong

Sorry, should have tested...