Some compile fixes for #1113 + code style