Fixed some issues with module building