Apache FOP Code fix

Code fix
by
JM
:

Bugfix: Fixed two causes for ClassCastExceptions in BlockContainerLayoutManager.