Block validation
Fixing #3 and other various problems