fixed 5cde217 causing assertion failures in debug mode