Fix conventions and some logic

いろいろ！