Fixed bug in utilities