Fixed bug introduced by restructuring