Code cleanup, minor changes