Small bug fixing (thanks to Marco Chiarandini)