prime: improved code style and fixed warnings