Adding some temporary debugging information, fixed an issue with pass by value vs reference.