Fixing layer latch capability.

Latch now activates on key release, and deactivates on next key release.