Improvements for better build compatibilty across platforms