Improved performance and compatibility

Signed-off-by: nixnodes <code@eth.si>