Hacked up version of BWToolkit for 10.8.x compatibility. Don't use this for new projects.