Fixed problem with parsing closing brackets