Fixed failing tests. PR cleanup

Fixed braces issues around if-else blocks