Fixed, based on Marc Brooks solution

Based on https://github.com/umbraco/Umbraco-CMS/pull/143, verified by me