Bugfix setPrimaryButton
Several intermediate changes