Fixed Endriu's changes