Fixed a subtle bug. Somewhat ebarresing too.