Added cleanup of buffers as instructed in issue #290.
Merge branch 'master' into integration_testing_develop