Simplified types for better readability. Use appropriate types (size_t, byte_t...). Minor warning fixes.