Fixed logic layer bugs..