Some fixes made while debugging.