Fixed a bug with conditional compilation and removed code that was moved to the commons library.