Fixed some issues with the previous merge