Small fixes, source code cleanup