Fixed issue #359

Fixed bug with functional and simple brackets and tests for it.