Minor bug fixing and cleanup