Fix failing toJSON() Layer unit test