Removal of extraneous brackets