In some of my Beamer themes I used the answer at Make frametitle and block the same width in Beamer.
However now an issue has been raised which is demonstrated by the following MWE:
\documentclass{beamer}
\setbeamertemplate{block begin}{
\begin{beamercolorbox}[wd=\textwidth, ht=0.5cm, dp=0.2cm, leftskip=0.2cm]{block title}%
\usebeamerfont*{block title}%
{\rule[-0.4ex]{0mm}{2ex}\insertblocktitle}%
\end{beamercolorbox}%
{\ifbeamercolorempty[bg]{block body}{}{\nointerlineskip\vskip-0.5pt}}%
\usebeamerfont{block body}%
\begin{beamercolorbox}[wd=\textwidth, ht=0.5cm, dp=0.2cm, leftskip=0.2cm]{block body}%
\ifbeamercolorempty[bg]{block body}{\vskip-.25ex}{\vskip-.75ex}\vbox{}%
}
\setbeamertemplate{block end}{
\end{beamercolorbox}
\vspace*{.25cm}
}
\setbeamertemplate{frametitle}{
\vspace*{0.3cm}
\begin{beamercolorbox}[wd=\textwidth, dp=0.3cm, ht=0.9cm, leftskip=0.2cm]{frametitle}
\usebeamerfont{frametitle}\insertframetitle%
\end{beamercolorbox}
}
\setbeamercolor{block title}{bg=yellow}
\setbeamercolor{frametitle}{bg=yellow}
\begin{document}
\begin{frame}{Block}
This is text before the block.
\begin{block}{blocktitle} some text here
\begin{itemize}
\item This is an item in the block.
\end{itemize}
This is text after the itemize.
\end{block}
This is text after the block.
\end{frame}
\end{document}

As you can see, the block title, block body and the surrounding text gets all messed up and overlapped. Please help me solve this! It is also very important that the colored box containing the frametitle and the colored box containing the block title (and the colored box containing the block body, if there's any) stays the same width.
