Fixed build issues (reverted from commit 2f060da74de748b5602b10250644d432234d729a)