Fix errors and deprecation warnings

Space inside { missing.<br>Space inside } missing.<br>Space inside parentheses detected.