DAR-136 fixing some common code bugs which prevent several testscases to be run at once