Improved padding system

Not perfect, still some strange issues, but behaviour is more complete.