couple of bugs related to dynamic declarations