Some more debugging and clean up

Some more debugging and clean up