Bugfix from commit c0dd741a79af6334275dac0385d99c5c54fb52dd