Fix regression in beforebuild functions

They can be synchronous
Merge pull request #25 from HenrikJoreteg/syncbefore

Fix regression in beforebuild functions