fix wrong namespace of thrown exception
fix unlinking file on windows systems