Added hidesWhenStopped property

Also cleaned up the source code.