Fix bug, thanks to Thomas Trier