Fix #26 and made it complient to project's code style