Improving coding style, removing warnings