Fixed bug in layer caused by recent changes.