Fix build dependency issue casuing "Rebuild" to not work properly under VS

Fixes #592