Fixed issue#359

Resolved functional and simple brackets.
Tests for issue #359