Fixed bug which broke tests