Added support of different prefixes (like in Parity), some other bug fixes